/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Class;

/**
 *
 * @author aissaroot
 */
public class Conge{
    protected int id_Conge;
    protected String type_Conge;
    protected String date_debut_Conge;
    protected String date_fin_Conge;
    protected int nbr_jours_Conge;
    protected String justification_Conge;
    
    
    public Conge(){}
    
    // inisialiser un Conge
    public Conge(int id_Conge,String type_Conge,String date_debut_Conge,String date_fin_Conge,int nbr_jours_Conge,String justification_Conge)
       {
               this.id_Conge=id_Conge;
               this.type_Conge=type_Conge;
               this.date_debut_Conge=date_debut_Conge;
               this.date_fin_Conge=date_fin_Conge;
               this.nbr_jours_Conge=nbr_jours_Conge;
               this.justification_Conge=justification_Conge;
       }
    
    
    // ajouter un Conge
    public int Ajouter()
    {
    Connect cle=new Connect();
    String req="insert into conge(id_Conge,type_Conge,date_debut_Conge,date_fin_Conge,nbr_jours_Conge,justification_Conge) values("+id_Conge+",'"+type_Conge+"','"+date_debut_Conge+"','"+date_fin_Conge+"','"+nbr_jours_Conge+"','"+justification_Conge+"')";
    return cle.req_execute(req);
     }
    
    // modifier les données d'un Conge
    public int modifier()
    {
    Connect cle=new Connect();
    String req="update conge set type_Conge='"+type_Conge+"' , date_debut_Conge='"+date_debut_Conge+"' , date_fin_Conge='"+date_fin_Conge+"' , nbr_jours_Conge='"+nbr_jours_Conge+"' , justification_Conge='"+justification_Conge+"' where id_Conge="+id_Conge ;
    return cle.req_execute(req);
    }
    
    // supprimer un Conge
    public int supprimer()
    {
    Connect cle=new Connect();
    String req="delete from conge where id_Conge="+id_Conge;
    return cle.req_execute(req);
    }
}
